<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Why Ref.value</title>
    <script type="module">
      window.computed = (getter) => {
        let value = 0
        /**
         * watchEffect(() =>{ value = getter() })
         **/
        setTimeout(() => {
          value = '我变了'
        }, 1500)
        return value
      }

      window.computedRefValue = (getter) => {
        let ref = {
          value: null
        }
        /**
         * watchEffect(() =>{ value = getter() })
         **/
        setTimeout(() => {
          ref.value = '我变了'
        }, 1500)
        return ref
      }
    </script>
  </head>
  <body></body>
</html>
